package org.blogwu.learn.designpattern.chapter4.v2;

/**
 * 简单工厂方法
 * 缺点是,随着业务复杂,此类会不断进行修改
 */
public class VideoFactory {

    public static Video getVideoByType(String type) {
        type = type.toLowerCase();
        switch (type) {
            case "java":
                return new JavaVideo();
            case "python":
                return new PythonVedio();
            default:
                break;
        }
        return null;
    }

}
